import request from '../utils/request'

export const getQueryCourses = data => {
  return request({
    method: 'POST',
    url: '/front/course/getQueryCourses',
    data,
  })
}

export const getPurchaseCourse = () => {
  return request({
    method: 'GET',
    url: `/front/course/getPurchaseCourse`,
  })
}

export const getCourseById = courseId => {
  return request({
    method: 'GET',
    url: `/front/course/getCourseById`,
    params: {
      courseId,
    }
  })
}

export const getSectionAndLesson = courseId => {
  return request({
    method: 'GET',
    url: `/front/course/session/getSectionAndLesson`,
    params: {
      courseId,
    }
  })
}

export const getVideoInfo = lessonId => {
  return request({
    method: 'GET',
    url: '/front/course/media/videoPlayInfo',
    params: {
      lessonId,
    }
  })
}
